Skip to content

refactor(soup): move domain conversions out of models_soup - #10051

Closed
404Wolf wants to merge 3 commits into
mainfrom
wolf/reorg-models-soup-conversions
Closed

404Wolf wants to merge 3 commits into
mainfrom
wolf/reorg-models-soup-conversions

Conversation

@404Wolf

@404Wolf 404Wolf commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Why

Part of the repository reorganization (plan item N10). models_soup is the
crate of Soup wire models, but it also held the conversions from the
call, channels, crm and email domain models into those wire models.
That made a DTO crate depend on four domain crates. Its closure was 99
workspace crates, and models_search reached 104 through it.

MACRO-4973

How it works

  • Each domain crate owns its conversion in a new soup module:
    • channels::soup (behind its existing list feature) turns the old
      new_from_* constructors into From/TryFrom impls.
    • crm::soup and email::soup hold the From impls.
    • call::soup::soup_call_record_for_user replaces
      SoupCallRecord::from_record_for_user, because it needs the viewer. Its
      tests move with it, with placeholder emails changed to example.com.
  • The email conversions were doppleganger backward derives on the Soup
    types. They are now hand-written From impls, field for field, because
    the derive has to sit on the Soup type and so needs the email crate.
  • SoupMessageSender::from_message_sender stays in models_soup and takes
    the bot's name and avatar instead of channels::BotSenderProfile. It
    parses through channel_sender (the crate channels re-exports it from)
    instead of channels.
  • soup::domain::service uses the new From impls and function.

No Soup type changed, so serde and utoipa output are identical.

Crate Workspace closure before After
models_soup 99 17
models_search 104 22
search_service 123 117

soup, ai_tools, graphql_soup and others are unchanged, because they
depend on the domain crates directly.

models_soup held the Soup wire models and also the conversions from the
call, channels, crm and email domain models into them, so the DTO crate
depended on four domain crates and its closure was 99 workspace crates.
Each domain crate now owns its conversion in a soup module (From impls,
plus call::soup::soup_call_record_for_user for the viewer-relative call
record). The email conversions are hand-written instead of doppleganger
derives, field for field. models_soup drops call, channels, crm, email
and doppleganger, and its closure falls to 17 crates (models_search
104 -> 22). Wire shapes are unchanged: no Soup type was edited.

MACRO-4973
@macro-application

Copy link
Copy Markdown

@404Wolf 404Wolf added the run-ci Run CI on the PR's head commit; removed when the run starts label Nov 7, 2026
@github-actions github-actions Bot removed the run-ci Run CI on the PR's head commit; removed when the run starts label Nov 7, 2026
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features

    • Call, channel, CRM, and email data can now be formatted for Soup-compatible responses, including channel messages, participants, attachments, and thread details.
    • Bot messages can include the sender’s display name and avatar.
  • Refactor

    • Data formatting responsibilities have shifted across service areas. Some previous conversion paths are no longer available.

Conversion implementations move from models_soup into the call, channels, crm, and email crates. The Soup service uses the updated conversion paths. The generated workspace dependency-closure map reflects the dependency changes.

Merge Risk: Minimal · previous review 720ef

This refactor moves the Soup conversions into the domain crates without changing the wire types. No concrete merge-blocking risk was found, but main must be merged in to resolve the conflict so CI can run.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title follows conventional commits format, is under 72 characters, and describes the main change.
Description check Passed The description accurately covers the conversion moves and related dependency changes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 72ae7f6 and 720ef31.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock, !**/Cargo.lock
Files selected for processing: 21

  • .github/workspace-dep-closures.json
  • crates/call/Cargo.toml
  • crates/call/src/lib.rs
  • crates/call/src/soup.rs
  • crates/call/src/soup/test.rs
  • crates/channels/Cargo.toml
  • crates/channels/src/lib.rs
  • crates/channels/src/soup.rs
  • crates/crm/Cargo.toml
  • crates/crm/src/lib.rs
  • crates/crm/src/soup.rs
  • crates/email/Cargo.toml
  • crates/email/src/lib.rs
  • crates/email/src/soup.rs
  • crates/models_soup/Cargo.toml
  • crates/models_soup/src/call_record.rs
  • crates/models_soup/src/comms.rs
  • crates/models_soup/src/crm_company.rs
  • crates/models_soup/src/crm_contact.rs
  • crates/models_soup/src/email_thread.rs
  • crates/soup/src/domain/service.rs
Files with no reviewable changes: 2

  • crates/models_soup/src/crm_contact.rs
  • crates/models_soup/src/call_record.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.

@404Wolf 404Wolf added the run-ci Run CI on the PR's head commit; removed when the run starts label Nov 7, 2026
@github-actions github-actions Bot added cloud-storage and removed run-ci Run CI on the PR's head commit; removed when the run starts labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

@404Wolf 404Wolf added the run-ci Run CI on the PR's head commit; removed when the run starts label Nov 7, 2026
@github-actions github-actions Bot removed the run-ci Run CI on the PR's head commit; removed when the run starts label Nov 7, 2026
@404Wolf

404Wolf commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Folded into the single reorg PR #10111 (one PR for the whole reorganization). Its commits are there; closing this one.

@404Wolf 404Wolf closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant